import java.io.File;
import java.util.List;

import org.apache.commons.io.FileUtils;

import com.analyzer.entity.Word;
import com.analyzer.tcp.AnalyzerClient;
import com.analyzer.tool.Config;


/** @author wyy 
 * @version 1.0 
 * 2015-11-17 上午10:09:36
 */

public class TestClient {

	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		AnalyzerClient client=new AnalyzerClient();
		client.start("127.0.0.1",Config.getInt("server_port",789));
		client.getAnalyzer().init();
		String content="北京王码诚信科技有限公司 主要经营法律法规禁止的不得经营应经审批的未获审批前不得经营法律法规未规定审批的企业自主选择经营项目开展经营活动";
		List<Word> list=client.getAnalyzer().split(content,1);
		for (Word word : list) {
			System.out.print(word.getWord()+"/"+word.getCixing()+" ");
		}
		
		System.out.println(client.getAnalyzer().NLPIR_GetKeyWords(content, 10, false));
		
		System.out.println(client.getAnalyzer().NLPIR_GetNewWords(content, 10, false));
		
		System.out.println(client.getAnalyzer().NLPIR_FingerPrint(content));
		
		System.out.println(client.getAnalyzer().NLPIR_WordFreqStat(content));
		
		System.out.println(client.getAnalyzer().NLPIR_GetEngWordOrign("women"));
		
		System.out.println(client.getAnalyzer().NLPIR_GetLastErrorMsg());
		System.out.println(client.getAnalyzer().NLPIR_GetKeyWords(FileUtils.readFileToString(new File("content.txt"), "utf-8"), 5, false));
	}
	

}

